/**
 *  内部类：
 *  1.静态内部类：
 *
 */
class OuterClass {
    public int date1 = 1;
    private int date2 = 2;
    private static int date3 = 3;


    static class InnerClass {
        public int date4 = 4;
        private int date5 = 5;
        private static int date6 = 6;

        public void func() {
            OuterClass outerClass = new OuterClass();
            System.out.println(outerClass.date1);    // 要想访问外部类的成员，必须通过对象的引用进性访问！！
            System.out.println(outerClass.date2);
            System.out.println(date3);
            System.out.println(date4);
            System.out.println(date5);
            System.out.println(date6);
        }


    }


    public void func() {
        InnerClass innerClass = new InnerClass();
        System.out.println(date1);
        System.out.println(date2);
        System.out.println(date3);
        System.out.println(innerClass.date4);
        System.out.println(innerClass.date5); // 外部类可以访问内部类的额所有类，哪怕是private修饰的！！
        System.out.println(innerClass.date6);
    }

}



public class Test {
    public static void main(String[] args) {
        //实例化静态内部类：
        OuterClass.InnerClass innerClass = new OuterClass.InnerClass();
        innerClass.func();
        System.out.println("======");
        OuterClass outerClass = new OuterClass();
        outerClass.func();
    }
}
